/**
 *Created by Heqi on 2018/3/21.
 */
import http from '@/utils/http'
import convert from '@/utils/model-convert'
import { SearchArgument } from '@/models/customer/platform/survey-rank'

const URL = '/rest/boss/platform/client-survey-rank/list'
const THUMB_URL = '/rest/boss/platform/client-survey-rank/{id}/thumb-up'

export default {
  list ({search}, cb) {
    http.get(URL, {
      params: convert.toJson(search, SearchArgument)
    }).then(response => cb(response)).catch(trace => cb(trace.response))
  },
  thumb ({id}, cb) {
    http.put(THUMB_URL.replace('{id}', id), {
      headers: {
        'Content-Type': 'application/json'
      }
    }).then(response => cb(response)).catch(trace => cb(trace.response))
  }
}
